package partner_admin_logs

import (
	"gitee.com/theegg/go-brick/app/model"
	"time"
)

// 表名也是cache的tag
var TableName = "partner_admin_logs"

// 访问日志标
type PartnerAdminLogs struct {
	Id          int64
	AdminUserId int32     `xorm:"int(11) notnull  'admin_user_id'"`
	MenuId      string    `xorm:"varchar(64) notnull 'menu_id'"`
	ClientIp    string    `xorm:"char(15) notnull  'client_ip'"`
	Agent       string    `xorm:"text null  'agent'"`
	Device      string    `xorm:"varchar(32) notnull 'device'"`
	CreatedAt   time.Time `xorm:"notnull created 'created_at'"`

	Context *model.DbContext `xorm:"-"`
}

// 设定context
func (pal *PartnerAdminLogs) SetContext() *PartnerAdminLogs {
	pal.Context = dc
	return pal
}
